﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ListTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //List<int> list = new List<int>();
            //List<int> list1 = new List<int>(10);        // 指定容量
            //List<int> list2 = new List<int>() { 1, 325, 564, 44 };      // 初始化
            //List<int> list3 = new List<int>(10) { 1, 325, 564, 44 };

            MyList<int> myList = new MyList<int>(5);
            myList.Add(0);
            myList.Add(1);
            myList.Add(2);
            myList.Add(3);
            myList.Add(5);
            myList.Add(5);
            //Console.WriteLine(myList.Count);
            //Console.WriteLine(myList.Capacity);
            //for (int i = 0; i < myList.Count; i++)
            //{
            //    Console.Write(myList[i] + " ");
            //}
            //Console.WriteLine();

            //myList.Insert(3, 100);
            //for (int i = 0; i < myList.Count; i++)
            //{
            //    Console.Write(myList[i] + " ");
            //}
            //Console.WriteLine();

            //myList.RemoveAt(3);
            //for (int i = 0; i < myList.Count; i++)
            //{
            //    Console.Write(myList[i] + " ");
            //}
            //Console.WriteLine();

            Console.WriteLine(myList.IndexOf(5));
            Console.WriteLine(myList.LastIndexOf(5));
            myList.Sort();
            for (int i = 0; i < myList.Count; i++)
            {
                Console.Write(myList[i] + " ");
            }
            Console.WriteLine();

        }
    }
}
